<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script type="text/javascript">

    function Person() {
    }
    Person.prototype.name = '悟空'
    Person.prototype.age = '500'
    Person.prototype.gender = '男'
    Person.prototype.sayName = function () {
        console.log(this.name)
    }
    var person = new Person()

    // person.sayName()
    console.log(Person.prototype.isPrototypeOf(person)) //true

    var _proto_ = Object.getPrototypeOf(person)
    console.log(_proto_)

    var hasName = person.hasOwnProperty('name')
    console.log(hasName)
    person.name = '八戒'
    hasName = person.hasOwnProperty('name')
    console.log(hasName)

</script>

</body>
</html>
